package com.zzedu.web.controller;

import com.zzedu.common.annotation.Log;
import com.zzedu.common.enums.BusinessType;
import com.zzedu.common.enums.OperatorType;
import com.zzedu.manager.IZzSubjectContentManager;
import com.zzedu.result.Result;
import com.zzedu.utils.BaseReq;
import com.zzedu.stu.req.GetByIdSubjectContent;
import com.zzedu.stu.rsp.ApiZzSubjectContentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 课件、作业服务
 */
@RestController
@RequestMapping("subjectContent")
public class SubjectContentController {


    @Autowired
    IZzSubjectContentManager zzSubjectContentManager;


    /**
     * 作业、课件详情
     *
     * @param req
     * @return
     */
    @PostMapping(value = {"/getById"}, produces = {MediaType.APPLICATION_JSON_VALUE}, consumes = {MediaType.APPLICATION_JSON_VALUE})
    @Log(title = "作业、课件详情", businessType = BusinessType.APP_STUDENT, operatorType = OperatorType.MOBILE)
    public Result<ApiZzSubjectContentVO> getById(@Validated @RequestBody BaseReq<GetByIdSubjectContent> req) {
        return zzSubjectContentManager.getById(req.getData());
    }
}
